#ifndef SINGLEAPPWIN_H
#define SINGLEAPPWIN_H

#include <QObject>
#include <QLocalServer>

class SingleApp : public QObject
{
    Q_OBJECT
public:
    SingleApp(const QString& id, QObject* parent = 0);
    ~SingleApp();

    QString getLastErrorString() const;
    bool start();
    bool hasPreviousInstance();

signals:
    void newInstanceCreated();      // 新实例创建信号，针对信号处理，可对原APP进行界面唤起

private slots:
    void onNewConnection();

private:
    QLocalServer mServer;
    QString mName;
};

#endif // SINGLEAPPWIN_H
